package edu.imu.question.service;

import edu.imu.question.controller.form.UpdateUserForm;
import edu.imu.question.entity.ResponseResult;
import edu.imu.question.entity.User;
import edu.imu.question.util.HttpServletUtil;

import static edu.imu.question.config.GlobalConstant.SESSION_KEY_CURR_USER;

public interface LoginUserService {
    public static User getLoginUser() {
        return (User) (HttpServletUtil.getSession().getAttribute(SESSION_KEY_CURR_USER));
    }

    public void modifyUserInfo(UpdateUserForm form);

    public ResponseResult modifyPassword(String oldPassword, String newPassword);

    public ResponseResult bindPhone(String phone);

    public ResponseResult unbindPhone();

    public ResponseResult bindEmail(String email);

    public ResponseResult unbindEmail();

    public ResponseResult sendEmailCode(String email);
}
